package com.niguang.work.labour.api.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.niguang.work.labour.api.entity.AdminLaborUser;
import com.niguang.work.labour.api.entity.LaborCompany;
import com.niguang.work.labour.api.mapper.LaborCompanyMapper;
import com.niguang.work.labour.api.service.LaborCompanyService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * <p>
 * 'work.v_personSite' is not BASE TABLE 服务实现类
 * </p>
 *
 * @author 83673
 * @since 2018-11-17
 */
@Service
public class LaborCompanyServiceImpl extends ServiceImpl<LaborCompanyMapper, LaborCompany> implements LaborCompanyService {

    @Override
    @Transactional(rollbackFor = Exception.class)
    public void register(LaborCompany workLaborCompany, AdminLaborUser user) {
        workLaborCompany.insert();
        user.setLaborCompanyId(workLaborCompany.getId());
        user.updateById();
    }


}
